<template>
    <a-checkbox v-model:checked="InputValue" :disabled="readonly">{{ Option.Label }}</a-checkbox>
</template>
<script setup>
import { ref, watch, watchEffect } from 'vue';

const emit = defineEmits(['update:modelValue'])
const props = defineProps({
    Option: Object,
    modelValue: Boolean,
});

const InputValue = ref();

const readonly = ref(false);

watchEffect(() => {
    readonly.value = !!props.Option.readonly
})

watch(() => props.modelValue, val => {
    InputValue.value = val;
}, { immediate: true });

watch(InputValue, (val) => {
    emit('update:modelValue', val);
})


</script>
<style lang="less" scoped></style>